<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core'%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html>
<html>
<head>
	<%@include file="../include.jsp"%>
</head>
<body id="z_body">
	<div class="panel">
		<div class="panel-heading">
			<i class="icon icon-list"></i> 
			${act}单位
		</div>
		<div class="panel-body">
		
			<form class="form-horizontal" id="form1">
				<input name="act" value="${act}" type="hidden"/>
				
				<c:if test="${act == '修改'}">
						<input name="czType" value="edit" type="hidden"/>
					</c:if>
					<c:if test="${act == '新增'}">
						<input name="czType" value="add" type="hidden"/>
					</c:if>
				
				<div class="form-group">
					<!-- <label class="col-md-3 app_required">单位代码</label> -->
					<div class="col-md-6">
						<c:if test="${act == '新增'}">
							<input class="form-control" name="dwdm" value="${one.dwdm}" validType="notEmpty">
						</c:if>
						<c:if test="${act == '修改'}">
							<input  hidden name="dwdm" value="${one.dwdm}" readonly="readonly">
						</c:if>
					</div>
				</div>
				
				<input hidden name="dwjc" value="${one.dwjc}" validType="notEmpty">
				<%-- <div class="form-group">
					<label class="col-md-3 app_required">单位简称</label>
					<div class="col-md-6">
						<input class="form-control" name="dwjc" value="${one.dwjc}" validType="notEmpty">
					</div>
				</div> --%>
				<div class="form-group">
					<label class="col-md-3">电话号码</label>
					<div class="col-md-6">
						<input class="form-control" name="dhhm" value="${one.dhhm}" >
					</div>
				</div>
				
				<div class="form-group">
					<label class="col-md-3"></label>
					<div class="col-md-6">
						<a class="btn btn-primary" onclick="save()">保存</a> &nbsp;
						<c:if test="${act == '修改'}">
							<a class="btn btn-default" href="javascript:;" onclick="window.parent.window.closeWindow();">取消</a>
						</c:if>
						<c:if test="${act == '新增'}">
							<a class="btn btn-default" onclick="parent.closeModal()">取消</a>
						</c:if>
						
					</div>
				</div>
			</form>
			
		</div>
	</div>
	
	
<script type="text/javascript">
/**
 * 保存
 */
function save() {
	//提交
	if(validateForm("form1")) {//表单验证
		tool.save("save", $("#form1").serialize(), function(data) {//提交
			parent.getPage();
			setTimeout(function(){
				parent.closeModal()
			}, 800);
		});
	}
}
</script>

</body>
</html>